package com.wtgroup.demo.mianshi.设计模式.模拟枚举;

import lombok.Data;

/**
 * @author dafei
 * @version 0.1
 * @date 2021/1/11 0:39
 */
public abstract class SimulateEnum<T> {

    public static final SimulateEnum<Test1DTO> TEST1 = new SimulateEnum<Test1DTO>("SMS_123", "阿里爷爷") {
        @Override
        public Test1DTO createDto() {
            return new Test1DTO();
        }
    };
    public static final SimulateEnum<Test2DTO> TEST2 = new SimulateEnum<Test2DTO>("SMS_123", "阿里爷爷") {
        @Override
        public Test2DTO createDto() {
            return new Test2DTO();
        }
    };


    private final String templateCode;
    private final String signName;

    public SimulateEnum(String templateCode, String signName) {
        this.templateCode = templateCode;
        this.signName = signName;
    }

    public abstract T createDto();

    @Data
    public static class Test1DTO {
        private String code;
        private String name;
    }

    @Data
    public static class Test2DTO {
        private String code;
        private String name;
    }
}
